from pathlib import Path
import streamlit as st

class StyleManager:
    @staticmethod
    def load_css():
        """加载CSS样式"""
        css_file = Path(__file__).parent.parent / "styles" / "main.css"
        with open(css_file) as f:
            st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
    
    @staticmethod
    def apply_class(element: str, class_name: str) -> str:
        """给HTML元素添加类名"""
        return f'<div class="{class_name}">{element}</div>'
    
    @staticmethod
    def wrap_message(content: str) -> str:
        """包装消息内容"""
        return f'<div class="message-content">{content}</div>' 